package com.lvmama.task.common.service;

import com.lvmama.task.common.vo.Task;
import com.lvmama.task.common.vo.TaskJobLog;

import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.<p/>
 * User: troy-kou<p/>
 * Date: 14-1-3<p/>
 * Time: 上午10:52<p/>
 * Email:kouhongyu@163.com<p/>
 */
public interface TaskService {

    public Long getTaskCount(Map<String, Object> paramMap);

    public List<Task> getTaskList(Map<String, Object> paramMap);
    
    public List<Task> getTaskListByInTaskId(String selects);

    public void saveTask(Task task, String realName);

    /**
     * 运行时的任务表更新
     * <p/>
     * 只更新 STATUS, NEXT_RUN_TIME, LAST_STATUS, LAST_TIME 这几个字段,避免更新CLOB等大字段对数据的压力
     *
     * @param task
     * @return
     */
    public void saveTaskRuntime(Task task);

    public Task getTask(Long taskId);

    public void delTask(String taskIds);

    public TaskJobLog addTaskJobLog(TaskJobLog taskJobLog);

    public void updateTaskJobLog(TaskJobLog taskJobLog);

    public Long getTaskJobLogCount(Map<String, Object> paramMap);

    public List<TaskJobLog> getTaskJobLogList(Map<String, Object> paramMap);

    public TaskJobLog getTaskJobLog(String taskJobLogId);

    public Integer cleanupTaskJobLog(Long taskId, Integer integer);

    public void copyTask(String taskIds, Integer copyCount, String taskNamePrefix, String jobNode, String serial, String realName);

    public void enableDisableTask(String taskIds, String realName);

    void immediatelyRunTask(String taskIds, String realName);

    void batchModifyTask(String taskIds, Task task, String realName);
}
